<html>
<head>
<title></title>
<style type="text/css">
	#transparentDiv
	{
		/* Display it on the layer with index 1001.
		   Make sure this is the highest z-index value
		   used by layers on that page */
		z-index:10;
		 
		/* make it cover the whole screen */
		position: absolute;
		top: 0%;
		left: 0%;
		width: 100%;
		height: 100%;

	 
		/* make it white but fully transparent */
		background-color: black;
		opacity:.50;
		filter: alpha(opacity=50);
	}
	
	#popupDiv
	{
		z-index:11;
		
		position: absolute;
		top: 50%;
		left: 50%;
		margin-left: -70px;
		margin-top: -70px;
		width: 400px;
		height:500px;
		
		background-color: aqua;
	}

</style>
<script language="javascript" type="text/javascript">
function pop() {
	
		document.getElementById('transparentDiv').style.display='block';
		document.getElementById('popupDiv').style.display='block';
		
		//document.getELementById('popupDiv').innerHTML=
	}
	
function hide() {
		document.getElementById('transparentDiv').style.display='none';
		document.getElementById('popupDiv').style.display='none';
	}
</script>
</head>
<body>
<div id="transparentDiv" style='<?php if (!isset($_POST['islogin'])) echo "display:none" ?>' > 
</div>
<div id="popupDiv" style='<?php if (!isset($_POST['islogin'])) echo "display:none" ?>'>
	<form name="login" action="pop.php" method="post">
		username = <input name="username" type="text" /><br />
		password = <input name="password" type="password" /><br />
		<input name="islogin" type="text" value="1" style="display : none" />
		<input type="submit" value="log in" />
		
		<?php 
			if (isset($_POST['islogin'])) {
				$islogin = ((isset($_POST['login']))? $_POST['login'] : "undefined"); 
				$username = ((isset($_POST['username']))? $_POST['username'] : "undefined");
				$password = ((isset($_POST['password']))? $_POST['password'] : "undefined");
				
				$mysql_db = "progin_171_13509027";
				$mysql_user = "progin";
				$mysql_pass = "progin";
				$mysql_link = mysql_connect("localhost", $mysql_user, $mysql_pass);
				mysql_select_db($mysql_db, $mysql_link);
				
				$result = mysql_query("SELECT password FROM user WHERE username='$username'") or die(mysql_error());
				$realpass=mysql_fetch_array($result);
				if ($password == $realpass['password']) {
					echo "sukses!";
				} else {
					echo "gagal..";
				}
			}
		?>
	</form>
		<input type="submit" value="cancel" onclick="return hide()" />
</div>
<p onclick="return pop()"> POP </a>
</body>
</html>